#ifndef LINTTOOLBAR_H_QQIUYNGHK
#define LINTTOOLBAR_H_QQIUYNGHK

#include "../../../../kegui_global.h"

#include <QWidget>
#include <QPaintEvent>
#include <QFont>
#include <QPointF>

#include "LineEditView.h"

namespace kepen {
namespace core {

class KEGUI_EXPORT LineToolBar : public QWidget
{
    Q_OBJECT
public:
    explicit LineToolBar(QWidget *parent,LineEditView *eParam,const int* menu,std::size_t count);
    ~LineToolBar();
    bool eventFilter(QObject *watched, QEvent *event) override;
protected:
    void leaveEvent(QEvent *) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void paintEvent(QPaintEvent *) override;

private:
    int getGridWidth(std::size_t length,const int *param, int *cellWidthArr);
    int getIdOfTouched(const QPointF &point,int &comboBoxFlag);
    void onPaintButtons(QPainter *painter);
    void getBtnPosition(int id,QPoint &point);
private:
    LineEditView *editContext;
    bool isMouseLeftDown,isWindowDeactivate;
    const std::size_t m_nLengthMenu;
    int  m_nCellHeight,  m_nGridWidth,m_nWScreen;


    int m_nIdTouchedDown,m_nIdMouseOver;
    int comboBoxFlagLast;

    int *idMenuArray;
    int *cellWidthArr;

    QPointF ptDown;



Q_SIGNALS:
};


}
}
#endif // LineToolBar_H
